package org.zlb.algorithm.sort;

/**
 * TODO
 *
 * @author zhoulingbo
 * @date 2021/7/8 11:28
 */
public abstract class AbstractSort implements Sortable{

    abstract public void sort(int[] arr);

    public void swap(int[] arr, int i, int j) {
        arr[i] = arr[i] + arr[j];
        arr[j] = arr[i] - arr[j];
        arr[i] = arr[i] - arr[j];
    }

    public int compare(int x, int y) {
        return x - y;
    }
}
